package com.example.ucf;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Scanner;

import android.content.Context;
import android.util.Log;

import com.example.ucf.model.Team;

public class UCF_Manager{
	public static List<Team> times;
	
	public static void inicializaTimes(Context context){
		String nome, cor1, cor2, posicao, time;
		int veloc, altura, peso, passe, corrida, recep, tackle, cobertura, bloqueio, numero, idade;
		
		try {
			String[] arquivos = context.getAssets().list("times");
			
			for(String arq : arquivos){
				Log.d("Arquivo", arq);
				
				InputStream in = context.getAssets().open("times/"+arq);
				Scanner scan = new Scanner(in);
				if (in != null){
					time = scan.nextLine();
					cor1 = scan.nextLine();
					cor2 = scan.nextLine();
					
					while(scan.hasNext()){
						nome = scan.next();
						veloc = scan.nextInt();
						altura = scan.nextInt();
						peso = scan.nextInt();
						passe = scan.nextInt();
						corrida = scan.nextInt();
						recep = scan.nextInt();
						tackle = scan.nextInt();
						cobertura = scan.nextInt();
						bloqueio = scan.nextInt();
						numero = scan.nextInt();
						idade = scan.nextInt();
						posicao = scan.nextLine();
						
						//Log.e("Jog",nome+" "+numero+" "+idade+" "+posicao);
					}
					
					in.close();
				}
			}
		} catch (IOException e) {
		}
	}
}
